package com.example.demo.resource;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.application.dto.UserSaveReq;
import com.example.demo.application.service.IUserAppService;
import com.example.demo.common.validation.Update;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 2023年9月24日下午2:00:57
 *
 * @author hezonggui
 * @version 1.0
 */
@Slf4j
@Api(tags = "用户管理")
@RestController
@RequestMapping("/api/v1/user")
@RequiredArgsConstructor
public class UserResource {
	
	private final IUserAppService userAppService;
	
	@PostMapping("/update")
    @ApiOperation(value = "更新用户接口", httpMethod = "POST")
	public void saveUser(@Validated({Update.class}) @RequestBody UserSaveReq userSaveReq) {
		userAppService.saveUser(userSaveReq);
	}

}
